Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Change-Id: I64e8cfe478cb0ba438f40b0631d6e9049cdab567
20 files changed:
protected $mCategoryViewerClass = 'CategoryViewer';
/**
protected $mCategoryViewerClass = 'CategoryViewer';
/**
* @return WikiCategoryPage
*/
protected function newPage( Title $title ) {
* @return WikiCategoryPage
*/
protected function newPage( Title $title ) {
/**
* Constructor from a page id
/**
* Constructor from a page id
- * @param int $id article ID to load
+ * @param int $id Article ID to load
* @return CategoryPage|null
*/
public static function newFromID( $id ) {
* @return CategoryPage|null
*/
public static function newFromID( $id ) {
/**
* @throws MWException
/**
* @throws MWException
- * @param $collationName string
+ * @param string $collationName
* @return Collation
*/
static function factory( $collationName ) {
* @return Collation
*/
static function factory( $collationName ) {
/**
* Get the URL to redirect to, or an empty string if not redirect URL set
*
/**
* Get the URL to redirect to, or an empty string if not redirect URL set
*
*/
public function getRedirect() {
return $this->mRedirect;
*/
public function getRedirect() {
return $this->mRedirect;
/**
* Set the HTTP status code to send with the output.
*
/**
* Set the HTTP status code to send with the output.
*
- * @param $statusCode Integer
+ * @param int $statusCode
*/
public function setStatusCode( $statusCode ) {
$this->mStatusCode = $statusCode;
*/
public function setStatusCode( $statusCode ) {
$this->mStatusCode = $statusCode;
/**
* Get the value of the "rel" attribute for metadata links
*
/**
* Get the value of the "rel" attribute for metadata links
*
*/
public function getMetadataAttribute() {
# note: buggy CC software only reads first "meta" link
*/
public function getMetadataAttribute() {
# note: buggy CC software only reads first "meta" link
/**
* Get all styles added by extensions
*
/**
* Get all styles added by extensions
*
*/
function getExtStyle() {
return $this->mExtStyles;
*/
function getExtStyle() {
return $this->mExtStyles;
/**
* Get all registered JS and CSS tags for the header.
*
/**
* Get all registered JS and CSS tags for the header.
*
*/
function getScript() {
return $this->mScripts . $this->getHeadItems();
*/
function getScript() {
return $this->mScripts . $this->getHeadItems();
/**
* Filter an array of modules to remove insufficiently trustworthy members, and modules
* which are no longer registered (eg a page is cached before an extension is disabled)
/**
* Filter an array of modules to remove insufficiently trustworthy members, and modules
* which are no longer registered (eg a page is cached before an extension is disabled)
- * @param $modules Array
- * @param string $position if not null, only return modules with this position
- * @param $type string
- * @return Array
+ * @param array $modules
+ * @param string|null $position if not null, only return modules with this position
+ * @param string $type
+ * @return array
*/
protected function filterModules( $modules, $position = null, $type = ResourceLoaderModule::TYPE_COMBINED ) {
$resourceLoader = $this->getResourceLoader();
*/
protected function filterModules( $modules, $position = null, $type = ResourceLoaderModule::TYPE_COMBINED ) {
$resourceLoader = $this->getResourceLoader();
/**
* Get the list of modules to include on this page
*
/**
* Get the list of modules to include on this page
*
- * @param bool $filter whether to filter out insufficiently trustworthy modules
- * @param string $position if not null, only return modules with this position
- * @param $param string
- * @return Array of module names
+ * @param bool $filter Whether to filter out insufficiently trustworthy modules
+ * @param string|null $position If not null, only return modules with this position
+ * @param string $param
+ * @return array Array of module names
*/
public function getModules( $filter = false, $position = null, $param = 'mModules' ) {
$modules = array_values( array_unique( $this->$param ) );
*/
public function getModules( $filter = false, $position = null, $param = 'mModules' ) {
$modules = array_values( array_unique( $this->$param ) );
/**
* Get the list of module JS to include on this page
*
/**
* Get the list of module JS to include on this page
*
- * @param $filter
- * @param $position
+ * @param bool $filter
+ * @param string|null $position
- * @return array of module names
+ * @return array Array of module names
*/
public function getModuleScripts( $filter = false, $position = null ) {
return $this->getModules( $filter, $position, 'mModuleScripts' );
*/
public function getModuleScripts( $filter = false, $position = null ) {
return $this->getModules( $filter, $position, 'mModuleScripts' );
/**
* Get the list of module CSS to include on this page
*
/**
* Get the list of module CSS to include on this page
*
- * @param $filter
- * @param $position
+ * @param bool $filter
+ * @param string|null $position
- * @return Array of module names
+ * @return array Array of module names
*/
public function getModuleStyles( $filter = false, $position = null ) {
return $this->getModules( $filter, $position, 'mModuleStyles' );
*/
public function getModuleStyles( $filter = false, $position = null ) {
return $this->getModules( $filter, $position, 'mModuleStyles' );
/**
* Get the list of module messages to include on this page
*
/**
* Get the list of module messages to include on this page
*
- * @param $filter
- * @param $position
+ * @param bool $filter
+ * @param string|null $position
- * @return Array of module names
+ * @return array Array of module names
*/
public function getModuleMessages( $filter = false, $position = null ) {
return $this->getModules( $filter, $position, 'mModuleMessages' );
*/
public function getModuleMessages( $filter = false, $position = null ) {
return $this->getModules( $filter, $position, 'mModuleMessages' );
/**
* Sets ResourceLoader target for load.php links. If null, will be omitted
*
/**
* Sets ResourceLoader target for load.php links. If null, will be omitted
*
- * @param $target string|null
+ * @param string|null $target
*/
public function setTarget( $target ) {
$this->mTarget = $target;
*/
public function setTarget( $target ) {
$this->mTarget = $target;
/**
* Get an array of head items
*
/**
* Get an array of head items
*
*/
function getHeadItemsArray() {
return $this->mHeadItems;
*/
function getHeadItemsArray() {
return $this->mHeadItems;
/**
* Get all header items in a string
*
/**
* Get all header items in a string
*
*/
function getHeadItems() {
$s = '';
*/
function getHeadItems() {
$s = '';
/**
* Check if the header item $name is already set
*
/**
* Check if the header item $name is already set
*
- * @param string $name item name
- * @return Boolean
+ * @param string $name Item name
+ * @return bool
*/
public function hasHeadItem( $name ) {
return isset( $this->mHeadItems[$name] );
*/
public function hasHeadItem( $name ) {
return isset( $this->mHeadItems[$name] );
/**
* Return whether the output will contain only the body of the article
*
/**
* Return whether the output will contain only the body of the article
*
*/
public function getArticleBodyOnly() {
return $this->mArticleBodyOnly;
*/
public function getArticleBodyOnly() {
return $this->mArticleBodyOnly;
/**
* Get the value of the "action text"
*
/**
* Get the value of the "action text"
*
*/
public function getPageTitleActionText() {
if ( isset( $this->mPageTitleActionText ) ) {
*/
public function getPageTitleActionText() {
if ( isset( $this->mPageTitleActionText ) ) {
* "HTML title" means the contents of "<title>".
* It is stored as plain, unescaped text and will be run through htmlspecialchars in the skin file.
*
* "HTML title" means the contents of "<title>".
* It is stored as plain, unescaped text and will be run through htmlspecialchars in the skin file.
*
*/
public function setHTMLTitle( $name ) {
if ( $name instanceof Message ) {
*/
public function setHTMLTitle( $name ) {
if ( $name instanceof Message ) {
/**
* Return the "HTML title", i.e. the content of the "<title>" tag.
*
/**
* Return the "HTML title", i.e. the content of the "<title>" tag.
*
*/
public function getHTMLTitle() {
return $this->mHTMLtitle;
*/
public function getHTMLTitle() {
return $this->mHTMLtitle;
/**
* Set $mRedirectedFrom, the Title of the page which redirected us to the current page.
*
/**
* Set $mRedirectedFrom, the Title of the page which redirected us to the current page.
*
*/
public function setRedirectedFrom( $t ) {
$this->mRedirectedFrom = $t;
*/
public function setRedirectedFrom( $t ) {
$this->mRedirectedFrom = $t;
* This function automatically sets \<title\> to the same content as \<h1\> but with all tags removed.
* Bad tags that were escaped in \<h1\> will still be escaped in \<title\>, and good tags like \<i\> will be dropped entirely.
*
* This function automatically sets \<title\> to the same content as \<h1\> but with all tags removed.
* Bad tags that were escaped in \<h1\> will still be escaped in \<title\>, and good tags like \<i\> will be dropped entirely.
*
- * @param $name string|Message
+ * @param string|Message $name
*/
public function setPageTitle( $name ) {
if ( $name instanceof Message ) {
*/
public function setPageTitle( $name ) {
if ( $name instanceof Message ) {
/**
* Return the "page title", i.e. the content of the \<h1\> tag.
*
/**
* Return the "page title", i.e. the content of the \<h1\> tag.
*
*/
public function getPageTitle() {
return $this->mPagetitle;
*/
public function getPageTitle() {
return $this->mPagetitle;
/**
* Set the Title object to use
*
/**
* Set the Title object to use
*
- * @param $t Title object
*/
public function setTitle( Title $t ) {
$this->getContext()->setTitle( $t );
*/
public function setTitle( Title $t ) {
$this->getContext()->setTitle( $t );
/**
* Add a subtitle containing a backlink to a page
*
/**
* Add a subtitle containing a backlink to a page
*
- * @param $title Title to link to
+ * @param Title $title Title to link to
*/
public function addBacklinkSubtitle( Title $title ) {
$query = array();
*/
public function addBacklinkSubtitle( Title $title ) {
$query = array();
*/
public function getSubtitle() {
return implode( "<br />\n\t\t\t\t", $this->mSubtitle );
*/
public function getSubtitle() {
return implode( "<br />\n\t\t\t\t", $this->mSubtitle );
/**
* Return whether the page is "printable"
*
/**
* Return whether the page is "printable"
*
*/
public function isPrintable() {
return $this->mPrintable;
*/
public function isPrintable() {
return $this->mPrintable;
/**
* Return whether the output will be completely disabled
*
/**
* Return whether the output will be completely disabled
*
*/
public function isDisabled() {
return $this->mDoNothing;
*/
public function isDisabled() {
return $this->mDoNothing;
/**
* Show an "add new section" link?
*
/**
* Show an "add new section" link?
*
*/
public function showNewSectionLink() {
return $this->mNewSectionLink;
*/
public function showNewSectionLink() {
return $this->mNewSectionLink;
/**
* Forcibly hide the new section link?
*
/**
* Forcibly hide the new section link?
*
*/
public function forceHideNewSectionLink() {
return $this->mHideNewSectionLink;
*/
public function forceHideNewSectionLink() {
return $this->mHideNewSectionLink;
/**
* Should we output feed links for this page?
/**
* Should we output feed links for this page?
*/
public function isSyndicated() {
return count( $this->mFeedLinks ) > 0;
*/
public function isSyndicated() {
return count( $this->mFeedLinks ) > 0;
* corresponding article on the wiki
* Setting true will cause the change "article related" toggle to true
*
* corresponding article on the wiki
* Setting true will cause the change "article related" toggle to true
*
*/
public function setArticleFlag( $v ) {
$this->mIsarticle = $v;
*/
public function setArticleFlag( $v ) {
$this->mIsarticle = $v;
* Return whether the content displayed page is related to the source of
* the corresponding article on the wiki
*
* Return whether the content displayed page is related to the source of
* the corresponding article on the wiki
*
*/
public function isArticle() {
return $this->mIsarticle;
*/
public function isArticle() {
return $this->mIsarticle;
* Set whether this page is related an article on the wiki
* Setting false will cause the change of "article flag" toggle to false
*
* Set whether this page is related an article on the wiki
* Setting false will cause the change of "article flag" toggle to false
*
*/
public function setArticleRelated( $v ) {
$this->mIsArticleRelated = $v;
*/
public function setArticleRelated( $v ) {
$this->mIsArticleRelated = $v;
/**
* Return whether this page is related an article on the wiki
*
/**
* Return whether this page is related an article on the wiki
*
*/
public function isArticleRelated() {
return $this->mIsArticleRelated;
*/
public function isArticleRelated() {
return $this->mIsArticleRelated;
/**
* Get the list of language links
*
/**
* Get the list of language links
*
- * @return Array of Interwiki Prefixed (non DB key) Titles (e.g. 'fr:Test page')
+ * @return array Array of Interwiki Prefixed (non DB key) Titles (e.g. 'fr:Test page')
*/
public function getLanguageLinks() {
return $this->mLanguageLinks;
*/
public function getLanguageLinks() {
return $this->mLanguageLinks;
* hidden categories) and $link a HTML fragment with a link to the category
* page
*
* hidden categories) and $link a HTML fragment with a link to the category
* page
*
*/
public function getCategoryLinks() {
return $this->mCategoryLinks;
*/
public function getCategoryLinks() {
return $this->mCategoryLinks;
/**
* Get the list of category names this page belongs to
*
/**
* Get the list of category names this page belongs to
*
- * @return Array of strings
+ * @return array Array of strings
*/
public function getCategories() {
return $this->mCategories;
*/
public function getCategories() {
return $this->mCategories;
* Return whether user JavaScript is allowed for this page
* @deprecated since 1.18 Load modules with ResourceLoader, and origin and
* trustworthiness is identified and enforced automagically.
* Return whether user JavaScript is allowed for this page
* @deprecated since 1.18 Load modules with ResourceLoader, and origin and
* trustworthiness is identified and enforced automagically.
*/
public function isUserJsAllowed() {
wfDeprecated( __METHOD__, '1.18' );
*/
public function isUserJsAllowed() {
wfDeprecated( __METHOD__, '1.18' );
* Show what level of JavaScript / CSS untrustworthiness is allowed on this page
* @see ResourceLoaderModule::$origin
* @param string $type ResourceLoaderModule TYPE_ constant
* Show what level of JavaScript / CSS untrustworthiness is allowed on this page
* @see ResourceLoaderModule::$origin
* @param string $type ResourceLoaderModule TYPE_ constant
- * @return Int ResourceLoaderModule ORIGIN_ class constant
+ * @return int ResourceLoaderModule ORIGIN_ class constant
*/
public function getAllowedModules( $type ) {
if ( $type == ResourceLoaderModule::TYPE_COMBINED ) {
*/
public function getAllowedModules( $type ) {
if ( $type == ResourceLoaderModule::TYPE_COMBINED ) {
/**
* Set the highest level of CSS/JS untrustworthiness allowed
/**
* Set the highest level of CSS/JS untrustworthiness allowed
- * @param $type String ResourceLoaderModule TYPE_ constant
- * @param $level Int ResourceLoaderModule class constant
+ * @param string $type ResourceLoaderModule TYPE_ constant
+ * @param int $level ResourceLoaderModule class constant
*/
public function setAllowedModules( $type, $level ) {
$this->mAllowedModules[$type] = $level;
*/
public function setAllowedModules( $type, $level ) {
$this->mAllowedModules[$type] = $level;
/**
* As for setAllowedModules(), but don't inadvertently make the page more accessible
/**
* As for setAllowedModules(), but don't inadvertently make the page more accessible
- * @param $type String
- * @param $level Int ResourceLoaderModule class constant
+ * @param string $type
+ * @param int $level ResourceLoaderModule class constant
*/
public function reduceAllowedModules( $type, $level ) {
$this->mAllowedModules[$type] = min( $this->getAllowedModules( $type ), $level );
*/
public function reduceAllowedModules( $type, $level ) {
$this->mAllowedModules[$type] = min( $this->getAllowedModules( $type ), $level );
- * @param $element string
- * @param $attribs array
- * @param $contents string
+ * @param string $element
+ * @param array $attribs
+ * @param string $contents
*/
public function addElement( $element, $attribs = array(), $contents = '' ) {
$this->addHTML( Html::element( $element, $attribs, $contents ) );
*/
public function addElement( $element, $attribs = array(), $contents = '' ) {
$this->addHTML( Html::element( $element, $attribs, $contents ) );
/**
* Get/set the ParserOptions object to use for wikitext parsing
*
/**
* Get/set the ParserOptions object to use for wikitext parsing
*
- * @param $options ParserOptions|null either the ParserOption to use or null to only get the
- * current ParserOption object
- * @return ParserOptions object
+ * @param ParserOptions|null $options Either the ParserOption to use or null to only get the
+ * current ParserOption object
+ * @return ParserOptions
*/
public function parserOptions( $options = null ) {
if ( !$this->mParserOptions ) {
*/
public function parserOptions( $options = null ) {
if ( !$this->mParserOptions ) {
/**
* Get the displayed revision ID
*
/**
* Get the displayed revision ID
*
*/
public function getRevisionId() {
return $this->mRevisionId;
*/
public function getRevisionId() {
return $this->mRevisionId;
* Get the timestamp of displayed revision.
* This will be null if not filled by setRevisionTimestamp().
*
* Get the timestamp of displayed revision.
* This will be null if not filled by setRevisionTimestamp().
*
- * @return String or null
*/
public function getRevisionTimestamp() {
return $this->mRevisionTimestamp;
*/
public function getRevisionTimestamp() {
return $this->mRevisionTimestamp;
/**
* Get the displayed file version
*
/**
* Get the displayed file version
*
- * @return Array|null ('time' => MW timestamp, 'sha1' => sha1)
+ * @return array|null ('time' => MW timestamp, 'sha1' => sha1)
*/
public function getFileVersion() {
return $this->mFileVersion;
*/
public function getFileVersion() {
return $this->mFileVersion;
/**
* Get the templates used on this page
*
/**
* Get the templates used on this page
*
- * @return Array (namespace => dbKey => revId)
+ * @return array (namespace => dbKey => revId)
* @since 1.18
*/
public function getTemplateIds() {
* @since 1.18
*/
public function getTemplateIds() {
/**
* Get the files used on this page
*
/**
* Get the files used on this page
*
- * @return Array (dbKey => array('time' => MW timestamp or null, 'sha1' => sha1 or ''))
+ * @return array (dbKey => array('time' => MW timestamp or null, 'sha1' => sha1 or ''))
* @since 1.18
*/
public function getFileSearchOptions() {
* @since 1.18
*/
public function getFileSearchOptions() {
/**
* Add a ParserOutput object, but without Html
*
/**
* Add a ParserOutput object, but without Html
*
- * @param $parserOutput ParserOutput object
+ * @param ParserOutput $parserOutput
*/
public function addParserOutputNoText( &$parserOutput ) {
$this->mLanguageLinks += $parserOutput->getLanguageLinks();
*/
public function addParserOutputNoText( &$parserOutput ) {
$this->mLanguageLinks += $parserOutput->getLanguageLinks();
/**
* Add a ParserOutput object
*
/**
* Add a ParserOutput object
*
- * @param $parserOutput ParserOutput
+ * @param ParserOutput $parserOutput
*/
function addParserOutput( &$parserOutput ) {
$this->addParserOutputNoText( $parserOutput );
*/
function addParserOutput( &$parserOutput ) {
$this->addParserOutputNoText( $parserOutput );
/**
* Add the output of a QuickTemplate to the output buffer
*
/**
* Add the output of a QuickTemplate to the output buffer
*
- * @param $template QuickTemplate
+ * @param QuickTemplate $template
*/
public function addTemplate( &$template ) {
$this->addHTML( $template->getHTML() );
*/
public function addTemplate( &$template ) {
$this->addHTML( $template->getHTML() );
/**
* Parse wikitext and return the HTML.
*
/**
* Parse wikitext and return the HTML.
*
* @param bool $linestart Is this the start of a line?
* @param bool $interface Use interface language ($wgLang instead of
* $wgContLang) while parsing language sensitive magic words like GRAMMAR and PLURAL.
* @param bool $linestart Is this the start of a line?
* @param bool $interface Use interface language ($wgLang instead of
* $wgContLang) while parsing language sensitive magic words like GRAMMAR and PLURAL.
/**
* Use enableClientCache(false) to force it to send nocache headers
*
/**
* Use enableClientCache(false) to force it to send nocache headers
*
/**
* Get the list of cookies that will influence on the cache
*
/**
* Get the list of cookies that will influence on the cache
*
*/
function getCacheVaryCookies() {
global $wgCookiePrefix, $wgCacheVaryCookies;
*/
function getCacheVaryCookies() {
global $wgCookiePrefix, $wgCacheVaryCookies;
* Check if the request has a cache-varying cookie header
* If it does, it's very important that we don't allow public caching
*
* Check if the request has a cache-varying cookie header
* If it does, it's very important that we don't allow public caching
*
*/
function haveCacheVaryCookies() {
$cookieHeader = $this->getRequest()->getHeader( 'cookie' );
*/
function haveCacheVaryCookies() {
$cookieHeader = $this->getRequest()->getHeader( 'cookie' );
* Add an HTTP header that will influence on the cache
*
* @param string $header header name
* Add an HTTP header that will influence on the cache
*
* @param string $header header name
- * @param $option Array|null
+ * @param array|null $option
* @todo FIXME: Document the $option parameter; it appears to be for
* X-Vary-Options but what format is acceptable?
*/
* @todo FIXME: Document the $option parameter; it appears to be for
* X-Vary-Options but what format is acceptable?
*/
* Return a Vary: header on which to vary caches. Based on the keys of $mVaryHeader,
* such as Accept-Encoding or Cookie
*
* Return a Vary: header on which to vary caches. Based on the keys of $mVaryHeader,
* such as Accept-Encoding or Cookie
*
*/
public function getVaryHeader() {
return 'Vary: ' . join( ', ', array_keys( $this->mVaryHeader ) );
*/
public function getVaryHeader() {
return 'Vary: ' . join( ', ', array_keys( $this->mVaryHeader ) );
/**
* Get a complete X-Vary-Options header
*
/**
* Get a complete X-Vary-Options header
*
*/
public function getXVO() {
$cvCookies = $this->getCacheVaryCookies();
*/
public function getXVO() {
$cvCookies = $this->getCacheVaryCookies();
* This is the default for special pages. If you display a CSRF-protected
* form on an ordinary view page, then you need to call this function.
*
* This is the default for special pages. If you display a CSRF-protected
* form on an ordinary view page, then you need to call this function.
*
*/
public function preventClickjacking( $enable = true ) {
$this->mPreventClickjacking = $enable;
*/
public function preventClickjacking( $enable = true ) {
$this->mPreventClickjacking = $enable;
/**
* Add a "return to" link pointing to a specified title
*
/**
* Add a "return to" link pointing to a specified title
*
- * @param $title Title to link
- * @param array $query query string parameters
- * @param string $text text of the link (input is not escaped)
- * @param $options Options array to pass to Linker
+ * @param Title $title Title to link
+ * @param array $query Query string parameters
+ * @param string $text Text of the link (input is not escaped)
+ * @param array $options Options array to pass to Linker
*/
public function addReturnTo( $title, $query = array(), $text = null, $options = array() ) {
$link = $this->msg( 'returnto' )->rawParams(
*/
public function addReturnTo( $title, $query = array(), $text = null, $options = array() ) {
$link = $this->msg( 'returnto' )->rawParams(
* Add a "return to" link pointing to a specified title,
* or the title indicated in the request, or else the main page
*
* Add a "return to" link pointing to a specified title,
* or the title indicated in the request, or else the main page
*
- * @param $unused
- * @param $returnto Title or String to return to
- * @param string $returntoquery query string for the return to link
+ * @param mixed $unused
+ * @param Title|string $returnto Title or String to return to
+ * @param string $returntoquery Query string for the return to link
*/
public function returnToMain( $unused = null, $returnto = null, $returntoquery = null ) {
if ( $returnto == null ) {
*/
public function returnToMain( $unused = null, $returnto = null, $returntoquery = null ) {
if ( $returnto == null ) {
* TODO: Document
* @param array|string $modules One or more module names
* @param string $only ResourceLoaderModule TYPE_ class constant
* TODO: Document
* @param array|string $modules One or more module names
* @param string $only ResourceLoaderModule TYPE_ class constant
- * @param boolean $useESI
- * @param array $extraQuery with extra query parameters to add to each request. array( param => value )
- * @param boolean $loadCall If true, output an (asynchronous) mw.loader.load() call rather than a "<script src='...'>" tag
+ * @param bool $useESI
+ * @param array $extraQuery Array with extra query parameters to add to each request. array( param => value )
+ * @param bool $loadCall If true, output an (asynchronous) mw.loader.load() call rather than a "<script src='...'>" tag
* @return string The html "<script>", "<link>" and "<style>" tags
*/
protected function makeResourceLoaderLink( $modules, $only, $useESI = false, array $extraQuery = array(), $loadCall = false ) {
* @return string The html "<script>", "<link>" and "<style>" tags
*/
protected function makeResourceLoaderLink( $modules, $only, $useESI = false, array $extraQuery = array(), $loadCall = false ) {
* modules marked with position 'bottom', legacy scripts ($this->mScripts),
* user preferences, site JS and user JS.
*
* modules marked with position 'bottom', legacy scripts ($this->mScripts),
* user preferences, site JS and user JS.
*
- * @param $inHead boolean If true, this HTML goes into the "<head>", if false it goes into the "<body>"
+ * @param bool $inHead If true, this HTML goes into the "<head>", if false it goes into the "<body>"
* @return string
*/
function getScriptsForBottomQueue( $inHead ) {
* @return string
*/
function getScriptsForBottomQueue( $inHead ) {
/**
* Get the javascript config vars to include on this page
*
/**
* Get the javascript config vars to include on this page
*
- * @return Array of javascript config vars
+ * @return array Array of javascript config vars
* @since 1.23
*/
public function getJsConfigVars() {
* @since 1.23
*/
public function getJsConfigVars() {
- * Add one or more variables to be set in mw.config in JavaScript.
+ * Add one or more variables to be set in mw.config in JavaScript
- * @param $keys {String|Array} Key or array of key/value pairs.
- * @param $value {Mixed} [optional] Value of the configuration variable.
+ * @param string|array $keys Key or array of key/value pairs
+ * @param mixed $value [optional] Value of the configuration variable
*/
public function addJsConfigVars( $keys, $value = null ) {
if ( is_array( $keys ) ) {
*/
public function addJsConfigVars( $keys, $value = null ) {
if ( is_array( $keys ) ) {
*/
public function buildCssLinksArray() {
$links = array();
*/
public function buildCssLinksArray() {
$links = array();
* Like addWikiMsg() except the parameters are taken as an array
* instead of a variable argument list.
*
* Like addWikiMsg() except the parameters are taken as an array
* instead of a variable argument list.
*
- * @param $name string
- * @param $args array
+ * @param string $name
+ * @param array $args
*/
public function addWikiMsgArray( $name, $args ) {
$this->addHTML( $this->msg( $name, $args )->parseAsBlock() );
*/
public function addWikiMsgArray( $name, $args ) {
$this->addHTML( $this->msg( $name, $args )->parseAsBlock() );
*
* The newline after opening div is needed in some wikitext. See bug 19226.
*
*
* The newline after opening div is needed in some wikitext. See bug 19226.
*
*/
public function wrapWikiMsg( $wrap /*, ...*/ ) {
$msgSpecs = func_get_args();
*/
public function wrapWikiMsg( $wrap /*, ...*/ ) {
$msgSpecs = func_get_args();
*/
abstract class TitleArray implements Iterator {
/**
*/
abstract class TitleArray implements Iterator {
/**
- * @param $res ResultWrapper A SQL result including at least page_namespace and
+ * @param ResultWrapper $res A SQL result including at least page_namespace and
* page_title -- also can have page_id, page_len, page_is_redirect,
* page_latest (if those will be used). See Title::newFromRow.
* @return TitleArrayFromResult
* page_title -- also can have page_id, page_len, page_is_redirect,
* page_latest (if those will be used). See Title::newFromRow.
* @return TitleArrayFromResult
- * @param $res ResultWrapper
+ * @param ResultWrapper $res
* @return TitleArrayFromResult
*/
protected static function newFromResult_internal( $res ) {
* @return TitleArrayFromResult
*/
protected static function newFromResult_internal( $res ) {
- * @param $row ResultWrapper
+ * @param bool|ResultWrapper $row
* @return void
*/
protected function setCurrent( $row ) {
* @return void
*/
protected function setCurrent( $row ) {
abstract class UserArray implements Iterator {
/**
abstract class UserArray implements Iterator {
/**
- * @param $res ResultWrapper
+ * @param ResultWrapper $res
* @return UserArrayFromResult
*/
static function newFromResult( $res ) {
* @return UserArrayFromResult
*/
static function newFromResult( $res ) {
* @return UserArrayFromResult
*/
static function newFromIDs( $ids ) {
* @return UserArrayFromResult
*/
static function newFromIDs( $ids ) {
+ * @param ResultWrapper $res
* @return UserArrayFromResult
*/
protected static function newFromResult_internal( $res ) {
* @return UserArrayFromResult
*/
protected static function newFromResult_internal( $res ) {
- * @param $res ResultWrapper
+ * @param ResultWrapper $res
*/
function __construct( $res ) {
$this->res = $res;
*/
function __construct( $res ) {
$this->res = $res;
+ * @param bool|stdClass $row
* @return void
*/
protected function setCurrent( $row ) {
* @return void
*/
protected function setCurrent( $row ) {
- * Output a HTTP header, wrapper for PHP's
- * header()
+ * Output a HTTP header, wrapper for PHP's header()
* @param string $string header to output
* @param bool $replace replace current similar header
* @param string $string header to output
* @param bool $replace replace current similar header
- * @param $http_response_code null|int Forces the HTTP response code to the specified value.
+ * @param null|int $http_response_code Forces the HTTP response code to the specified value.
*/
public function header( $string, $replace = true, $http_response_code = null ) {
header( $string, $replace, $http_response_code );
*/
public function header( $string, $replace = true, $http_response_code = null ) {
header( $string, $replace, $http_response_code );
* Stores a HTTP header
* @param string $string header to output
* @param bool $replace replace current similar header
* Stores a HTTP header
* @param string $string header to output
* @param bool $replace replace current similar header
- * @param $http_response_code null|int Forces the HTTP response code to the specified value.
+ * @param null|int $http_response_code Forces the HTTP response code to the specified value.
*/
public function header( $string, $replace = true, $http_response_code = null ) {
if ( substr( $string, 0, 5 ) == 'HTTP/' ) {
*/
public function header( $string, $replace = true, $http_response_code = null ) {
if ( substr( $string, 0, 5 ) == 'HTTP/' ) {
/**
* Get the HTTP response code, null if not set
*
/**
* Get the HTTP response code, null if not set
*
*/
public function getStatusCode() {
return $this->code;
*/
public function getStatusCode() {
return $this->code;
* @return string
*/
public function getcookie( $name ) {
* @return string
*/
public function getcookie( $name ) {
*/
public function setFile( $file ) {
$this->mFile = $file;
*/
public function setFile( $file ) {
$this->mFile = $file;
/**
* The fields used to create the HTMLForm
/**
* The fields used to create the HTMLForm
*/
protected $fields;
/**
* Get the Action subclass which should be used to handle this action, false if
* the action is disabled, or null if it's not recognised
*/
protected $fields;
/**
* Get the Action subclass which should be used to handle this action, false if
* the action is disabled, or null if it's not recognised
- * @param $action String
- * @param $overrides Array
+ * @param string $action
+ * @param array $overrides
* @return bool|null|string|callable
*/
final private static function getClass( $action, array $overrides ) {
* @return bool|null|string|callable
*/
final private static function getClass( $action, array $overrides ) {
/**
* Get an appropriate Action subclass for the given action
/**
* Get an appropriate Action subclass for the given action
- * @param $action String
- * @param $page Page
- * @param $context IContextSource
- * @return Action|bool|null false if the action is disabled, null
+ * @param string $action
+ * @param Page $page
+ * @param IContextSource $context
+ * @return Action|bool|null False if the action is disabled, null
* if it is not recognised
*/
final public static function factory( $action, Page $page, IContextSource $context = null ) {
* if it is not recognised
*/
final public static function factory( $action, Page $page, IContextSource $context = null ) {
* $wgActions will be replaced by "nosuchaction".
*
* @since 1.19
* $wgActions will be replaced by "nosuchaction".
*
* @since 1.19
- * @param $context IContextSource
- * @return string: action name
+ * @param IContextSource $context
+ * @return string Action name
*/
final public static function getActionName( IContextSource $context ) {
global $wgActions;
*/
final public static function getActionName( IContextSource $context ) {
global $wgActions;
/**
* Check if a given action is recognised, even if it's disabled
*
/**
* Check if a given action is recognised, even if it's disabled
*
- * @param string $name name of an action
- * @return Bool
+ * @param string $name Name of an action
+ * @return bool
*/
final public static function exists( $name ) {
return self::getClass( $name, array() ) !== null;
*/
final public static function exists( $name ) {
return self::getClass( $name, array() ) !== null;
* Get a Message object with context set
* Parameters are the same as wfMessage()
*
* Get a Message object with context set
* Parameters are the same as wfMessage()
*
- * @return Message object
*/
final public function msg() {
$params = func_get_args();
*/
final public function msg() {
$params = func_get_args();
*
* Only public since 1.21
*
*
* Only public since 1.21
*
- * @param $page Page
- * @param $context IContextSource
+ * @param Page $page
+ * @param IContextSource $context
*/
public function __construct( Page $page, IContextSource $context = null ) {
if ( $context === null ) {
*/
public function __construct( Page $page, IContextSource $context = null ) {
if ( $context === null ) {
/**
* Return the name of the action this object responds to
/**
* Return the name of the action this object responds to
- * @return String lowercase
+ * @return string Lowercase name
*/
abstract public function getName();
/**
* Get the permission required to perform this action. Often, but not always,
* the same as the action name
*/
abstract public function getName();
/**
* Get the permission required to perform this action. Often, but not always,
* the same as the action name
*/
public function getRestriction() {
return null;
*/
public function getRestriction() {
return null;
* overridden by sub-classes with more complicated permissions schemes. Failures here
* must throw subclasses of ErrorPageError
*
* overridden by sub-classes with more complicated permissions schemes. Failures here
* must throw subclasses of ErrorPageError
*
- * @param $user User: the user to check, or null to use the context user
+ * @param User $user The user to check, or null to use the context user
* @throws UserBlockedError|ReadOnlyError|PermissionsError
* @return bool True on success
*/
* @throws UserBlockedError|ReadOnlyError|PermissionsError
* @return bool True on success
*/
/**
* Whether this action requires the wiki not to be locked
/**
* Whether this action requires the wiki not to be locked
*/
public function requiresWrite() {
return true;
*/
public function requiresWrite() {
return true;
/**
* Whether this action can still be executed by a blocked user
/**
* Whether this action can still be executed by a blocked user
*/
public function requiresUnblock() {
return true;
*/
public function requiresUnblock() {
return true;
/**
* Returns the name that goes in the \<h1\> page title
*
/**
* Returns the name that goes in the \<h1\> page title
*
*/
protected function getPageTitle() {
return $this->getTitle()->getPrefixedText();
*/
protected function getPageTitle() {
return $this->getTitle()->getPrefixedText();
/**
* Returns the description that goes below the \<h1\> tag
*
/**
* Returns the description that goes below the \<h1\> tag
*
*/
protected function getDescription() {
return $this->msg( strtolower( $this->getName() ) )->escaped();
*/
protected function getDescription() {
return $this->msg( strtolower( $this->getName() ) )->escaped();
/**
* Execute the action in a silent fashion: do not display anything or release any errors.
/**
* Execute the action in a silent fashion: do not display anything or release any errors.
- * @return Bool whether execution was successful
+ * @return bool whether execution was successful
*/
abstract public function execute();
}
*/
abstract public function execute();
}
* If the cache is enabled or not.
*
* @since 1.20
* If the cache is enabled or not.
*
* @since 1.20
*/
protected $cacheEnabled = true;
*/
protected $cacheEnabled = true;
* Sets if the cache should be enabled or not.
*
* @since 1.20
* Sets if the cache should be enabled or not.
*
* @since 1.20
- * @param boolean $cacheEnabled
+ * @param bool $cacheEnabled
*/
public function setCacheEnabled( $cacheEnabled ) {
$this->cacheHelper->setCacheEnabled( $cacheEnabled );
*/
public function setCacheEnabled( $cacheEnabled ) {
$this->cacheHelper->setCacheEnabled( $cacheEnabled );
- * @param integer|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp.
- * @param boolean|null $cacheEnabled Sets if the cache should be enabled or not.
+ * @param int|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp.
+ * @param bool|null $cacheEnabled Sets if the cache should be enabled or not.
*/
public function startCache( $cacheExpiry = null, $cacheEnabled = null ) {
$this->cacheHelper = new CacheHelper();
*/
public function startCache( $cacheExpiry = null, $cacheEnabled = null ) {
$this->cacheHelper = new CacheHelper();
- * @param integer $cacheExpiry
+ * @param int $cacheExpiry
*/
public function setExpiry( $cacheExpiry ) {
$this->cacheHelper->setExpiry( $cacheExpiry );
*/
public function setExpiry( $cacheExpiry ) {
$this->cacheHelper->setExpiry( $cacheExpiry );
- * @param boolean $hasCached
+ * @param bool $hasCached
*/
public function onCacheInitialized( $hasCached ) {
if ( $hasCached ) {
*/
public function onCacheInitialized( $hasCached ) {
if ( $hasCached ) {
/**
* This is largely cadged from PageHistory::history
*
/**
* This is largely cadged from PageHistory::history
*
*/
public function onView() {
wfProfileIn( __METHOD__ );
*/
public function onView() {
wfProfileIn( __METHOD__ );
/**
* Get a list of contributors
*
/**
* Get a list of contributors
*
- * @param int $cnt maximum list of contributors to show
- * @param bool $showIfMax whether to contributors if there more than $cnt
- * @return String: html
+ * @param int $cnt Maximum list of contributors to show
+ * @param bool $showIfMax Whether to contributors if there more than $cnt
+ * @return string html
*/
public function getCredits( $cnt, $showIfMax = true ) {
wfProfileIn( __METHOD__ );
*/
public function getCredits( $cnt, $showIfMax = true ) {
wfProfileIn( __METHOD__ );
/**
* Get the last author with the last modification time
* @param Page $page
/**
* Get the last author with the last modification time
* @param Page $page
*/
protected function getAuthor( Page $page ) {
$user = User::newFromName( $page->getUserText(), false );
*/
protected function getAuthor( Page $page ) {
$user = User::newFromName( $page->getUserText(), false );
/**
* Get a list of contributors of $article
/**
* Get a list of contributors of $article
- * @param int $cnt maximum list of contributors to show
- * @param bool $showIfMax whether to contributors if there more than $cnt
- * @return String: html
+ * @param int $cnt Maximum list of contributors to show
+ * @param bool $showIfMax Whether to contributors if there more than $cnt
+ * @return string html
*/
protected function getContributors( $cnt, $showIfMax ) {
global $wgHiddenPrefs;
*/
protected function getContributors( $cnt, $showIfMax ) {
global $wgHiddenPrefs;
/**
* Get a link to $user's user page
/**
* Get a link to $user's user page
- * @param $user User object
- * @return String: html
+ * @param User $user
+ * @return string Html
*/
protected function link( User $user ) {
global $wgHiddenPrefs;
*/
protected function link( User $user ) {
global $wgHiddenPrefs;
/**
* Get a link to $user's user page
/**
* Get a link to $user's user page
- * @param $user User object
- * @return String: html
+ * @param User $user
+ * @return string Html
*/
protected function userLink( User $user ) {
$link = $this->link( $user );
*/
protected function userLink( User $user ) {
$link = $this->link( $user );
/**
* Get a link to action=credits of $article page
/**
* Get a link to action=credits of $article page
- * @return String: HTML link
+ * @return string HTML link
*/
protected function othersLink() {
return Linker::linkKnown(
*/
protected function othersLink() {
return Linker::linkKnown(
/**
* Get an HTMLForm descriptor array
/**
* Get an HTMLForm descriptor array
*/
abstract protected function getFormFields();
/**
* Add pre- or post-text to the form
*/
abstract protected function getFormFields();
/**
* Add pre- or post-text to the form
- * @return String HTML which will be sent to $form->addPreText()
+ * @return string HTML which will be sent to $form->addPreText()
*/
protected function preText() {
return '';
*/
protected function preText() {
return '';
/**
* Play with the HTMLForm if you need to more substantially
/**
* Play with the HTMLForm if you need to more substantially
- * @param $form HTMLForm
+ * @param HTMLForm $form
*/
protected function alterForm( HTMLForm $form ) {
}
*/
protected function alterForm( HTMLForm $form ) {
}
* Process the form on POST submission. If you return false from getFormFields(),
* this will obviously never be reached. If you don't want to do anything with the
* form, just return false here
* Process the form on POST submission. If you return false from getFormFields(),
* this will obviously never be reached. If you don't want to do anything with the
* form, just return false here
- * @param $data Array
- * @return Bool|Array true for success, false for didn't-try, array of errors on failure
+ * @param array $data
+ * @return bool|array True for success, false for didn't-try, array of errors on failure
*/
abstract public function onSubmit( $data );
*/
abstract public function onSubmit( $data );
/**
* @see Action::execute()
*
/**
* @see Action::execute()
*
- * @param $data array|null
- * @param $captureErrors bool
+ * @param array|null $data
+ * @param bool $captureErrors
* @throws ErrorPageError|Exception
* @return bool
*/
* @throws ErrorPageError|Exception
* @return bool
*/
/**
* Show something on GET request.
/**
* Show something on GET request.
- * @return String|null will be added to the HTMLForm if present, or just added to the
+ * @return string|null Will be added to the HTMLForm if present, or just added to the
* output if not. Return null to not add anything
*/
abstract public function onView();
* output if not. Return null to not add anything
*/
abstract public function onView();
* @return bool
*/
public function onSubmit( $data ) {
* @return bool
*/
public function onSubmit( $data ) {
/**
* Execute the action silently, not giving any output. Since these actions don't have
* forms, they probably won't have any data, but some (eg rollback) may do
/**
* Execute the action silently, not giving any output. Since these actions don't have
* forms, they probably won't have any data, but some (eg rollback) may do
- * @param array $data values that would normally be in the GET request
- * @param bool $captureErrors whether to catch exceptions and just return false
+ * @param array $data Values that would normally be in the GET request
+ * @param bool $captureErrors Whether to catch exceptions and just return false
* @throws ErrorPageError|Exception
* @throws ErrorPageError|Exception
- * @return Bool whether execution was successful
+ * @return bool Whether execution was successful
*/
public function execute( array $data = null, $captureErrors = true ) {
try {
*/
public function execute( array $data = null, $captureErrors = true ) {
try {
* direction. This is now only used by the feeds. It was previously
* used by the main UI but that's now handled by the pager.
*
* direction. This is now only used by the feeds. It was previously
* used by the main UI but that's now handled by the pager.
*
- * @param $limit Integer: the limit number of revisions to get
- * @param $offset Integer
- * @param $direction Integer: either HistoryPage::DIR_PREV or HistoryPage::DIR_NEXT
+ * @param int $limit The limit number of revisions to get
+ * @param int $offset
+ * @param int $direction Either HistoryPage::DIR_PREV or HistoryPage::DIR_NEXT
* @return ResultWrapper
*/
function fetchRevisions( $limit, $offset, $direction ) {
* @return ResultWrapper
*/
function fetchRevisions( $limit, $offset, $direction ) {
* Borrows Recent Changes' feed generation functions for formatting;
* includes a diff to the previous revision (if any).
*
* Borrows Recent Changes' feed generation functions for formatting;
* includes a diff to the previous revision (if any).
*
- * @param $row Object: database row
+ * @param stdClass|array $row database row
* @return FeedItem
*/
function feedItem( $row ) {
* @return FeedItem
*/
function feedItem( $row ) {
/**
* Creates a submit button
*
/**
* Creates a submit button
*
- * @param string $message text of the submit button, will be escaped
- * @param array $attributes attributes
- * @return String: HTML output for the submit button
+ * @param string $message Text of the submit button, will be escaped
+ * @param array $attributes Attributes
+ * @return string HTML output for the submit button
*/
function submitButton( $message, $attributes = array() ) {
# Disable submit button if history has 1 revision only
*/
function submitButton( $message, $attributes = array() ) {
# Disable submit button if history has 1 revision only
/**
* Create a link to view this revision of the page
*
/**
* Create a link to view this revision of the page
*
- * @param $rev Revision
- * @return String
+ * @param Revision $rev
+ * @return string
*/
function revLink( $rev ) {
$date = $this->getLanguage()->userTimeAndDate( $rev->getTimestamp(), $this->getUser() );
*/
function revLink( $rev ) {
$date = $this->getLanguage()->userTimeAndDate( $rev->getTimestamp(), $this->getUser() );
/**
* Create a diff-to-current link for this revision for this page
*
/**
* Create a diff-to-current link for this revision for this page
*
- * @param $rev Revision
- * @param $latest Boolean: this is the latest revision of the page?
- * @return String
+ * @param Revision $rev
+ * @param bool $latest This is the latest revision of the page?
+ * @return string
*/
function curLink( $rev, $latest ) {
$cur = $this->historyPage->message['cur'];
*/
function curLink( $rev, $latest ) {
$cur = $this->historyPage->message['cur'];
/**
* Create a diff-to-previous link for this revision for this page.
*
/**
* Create a diff-to-previous link for this revision for this page.
*
- * @param $prevRev Revision: the previous revision
- * @param $next Mixed: the newer revision
- * @return String
+ * @param Revision $prevRev The previous revision
+ * @param mixed $next The newer revision
+ * @return string
*/
function lastLink( $prevRev, $next ) {
$last = $this->historyPage->message['last'];
*/
function lastLink( $prevRev, $next ) {
$last = $this->historyPage->message['last'];
/**
* Create radio buttons for page history
*
/**
* Create radio buttons for page history
*
- * @param $rev Revision object
- * @param $firstInList Boolean: is this version the first one?
+ * @param Revision $rev
+ * @param bool $firstInList Is this version the first one?
- * @return String: HTML output for the radio buttons
+ * @return string HTML output for the radio buttons
*/
function diffButtons( $rev, $firstInList ) {
if ( $this->getNumRows() > 1 ) {
*/
function diffButtons( $rev, $firstInList ) {
if ( $this->getNumRows() > 1 ) {
/**
* Returns the name of the action this object responds to.
*
/**
* Returns the name of the action this object responds to.
*
- * @return string lowercase
+ * @return string Lowercase name
*/
public function getName() {
return 'info';
*/
public function getName() {
return 'info';
/**
* Get a list of contributors of $article
/**
* Get a list of contributors of $article
*/
protected function getContributors() {
global $wgHiddenPrefs;
*/
protected function getContributors() {
global $wgHiddenPrefs;
* Get the text that should be returned, or false if the page or revision
* was not found.
*
* Get the text that should be returned, or false if the page or revision
* was not found.
*
*/
public function getRawText() {
global $wgParser;
*/
public function getRawText() {
global $wgParser;
/**
* Get the ID of the revision that should used to get the text.
*
/**
* Get the ID of the revision that should used to get the text.
*
*/
public function getOldId() {
$oldid = $this->getRequest()->getInt( 'oldid' );
*/
public function getOldId() {
$oldid = $this->getRequest()->getInt( 'oldid' );
/**
* Get the content type to use for the response
*
/**
* Get the content type to use for the response
*
*/
public function getContentType() {
$ctype = $this->getRequest()->getVal( 'ctype' );
*/
public function getContentType() {
$ctype = $this->getRequest()->getVal( 'ctype' );
protected $password;
/** @var bool Whether connections persist */
protected $persistent;
protected $password;
/** @var bool Whether connections persist */
protected $persistent;
- /** @var integer Serializer to use (Redis::SERIALIZER_*) */
+ /** @var int Serializer to use (Redis::SERIALIZER_*) */
protected $serializer;
/** @} */
protected $serializer;
/** @} */
/**
* @param string $script
* @param array $params
/**
* @param string $script
* @param array $params
- * @param integer $numKeys
* @return mixed
* @throws RedisException
*/
* @return mixed
* @throws RedisException
*/
- * @return String The model id
+ * @return string The model id
*/
public function getModel();
*/
public function getModel();
*/
public function getDefaultFormat();
*/
public function getDefaultFormat();
- * @return Content. A copy of this object
+ * @return Content A copy of this object
*/
public function copy();
*/
public function copy();
*/
abstract class DBAccessBase implements IDBAccessObject {
/**
*/
abstract class DBAccessBase implements IDBAccessObject {
/**
- * @var String|bool $wiki The target wiki's name. This must be an ID
+ * @var string|bool $wiki The target wiki's name. This must be an ID
* that LBFactory can understand.
*/
protected $wiki = false;
* that LBFactory can understand.
*/
protected $wiki = false;
- * @param DatabaseBase $db the database connection to release.
+ * @param DatabaseBase $db The database connection to release.
*/
protected function releaseConnection( DatabaseBase $db ) {
if ( $this->wiki !== false ) {
*/
protected function releaseConnection( DatabaseBase $db ) {
if ( $this->wiki !== false ) {